import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token.js'

//文章分类列表查询
export const ArticleCategoryListService = () => {
  // const tokenStore = useTokenStore();
  console.log("-----" + request.get('/category'));
  return request.get('/category')
}

// 增加文章的分类的接口函数

export const articleCategoryAddService = (categoryData) => {
  return request.post('/category', categoryData)
}

//文章分类的修改
export const articleCategoryUpdateService = (categoryData) => {
  return request.put('/category', categoryData)
}

//文章分类删除
export const articleCategoryDeleteService = (id) => {
  return request.delete('/category?id=' + id)
}

//文章列表查询
export const articleListService = (params) => {
  return request.get('/article', {
    params: params
  })
}

// 文章的添加
export const articleAddService = (articleData) => {
  return request.post('/article', articleData)
}

//文章的删除
export const articleDeleteService = (row) => {
  console.log(row);
  return request.delete('/article?id=' + row)
}

